﻿using System.Collections.Generic;
using System.Linq;

namespace Inscriptionem.Areas.Inscriptionem.Models.Views
{
    public class CommentSearchCollectionViewModel
    {
        public IEnumerable<ORM.Comment> Comments { get; protected set; }

        public CommentSearchCollectionViewModel()
        {
            Comments = new ORM.DB().Comments.Where(c => !c.IsPublished && !c.IsDeleted)
                .Where(c => c.Content.ToLower().Contains(Text.ToLower())).OrderBy(c => c.ID);
        }

        public string Text { get; set; }

        public int Page { get; set; }
    }
}